import request from './index.js'
import { API_CONFIG } from '../config/api.js'

// 认证相关API
export const authApi = {
    // 获取租户列表
    getTenantList() {
        return request({
            url: API_CONFIG.ENDPOINTS.AUTH.TENANT_LIST,
            method: 'GET'
        })
    },

    // 用户登录
    login(data) {
        return request({
            url: API_CONFIG.ENDPOINTS.AUTH.LOGIN,
            method: 'POST',
            data
        })
    },

    // 用户退出登录
    logout() {
        return request({
            url: API_CONFIG.ENDPOINTS.AUTH.LOGOUT,
            method: 'POST'
        })
    },

    // 获取短信验证码
    getSmsCode(phoneNumber) {
        return request({
            url: `${API_CONFIG.ENDPOINTS.AUTH.SMS_CODE}?phonenumber=${phoneNumber}`,
            method: 'GET'
        })
    },

    // 获取图形验证码
    getPicCode() {
        return request({
            url: API_CONFIG.ENDPOINTS.AUTH.PIC_CODE,
            method: 'GET'
        })
    }
}